
#include <bloom_filter.h>
#include <gtest/gtest.h>
	
	
int main(int argc, char **argv)
{
	srand((unsigned)time(NULL));
 	testing::InitGoogleTest(&argc, argv);
	return RUN_ALL_TESTS();
}
 
/**
 * @brief 
**/
class test_bloom_filter_t_create_suite : public ::testing::Test
{
    protected:
        test_bloom_filter_t_create_suite():bf(10*10000*10000){};
        virtual ~test_bloom_filter_t_create_suite(){};
        virtual void SetUp()
        {
            //Called befor every TEST_F(test_bloom_filter_t_create_suite, *)
        };
        virtual void TearDown()
        {
            //Called after every TEST_F(test_bloom_filter_t_create_suite, *)
        };
        bloom_filter_t bf;
};
 
/**
 * @brief 
 * @begin_version 
**/
TEST_F(test_bloom_filter_t_create_suite, case_name1)
{
	EXPECT_EQ(0, bf.create());
}
 
/**
 * @brief 
**/
class test_bloom_filter_t_insert_suite : public ::testing::Test
{
    protected:
        test_bloom_filter_t_insert_suite():bf(5*10000*10000, 0.01){};
        virtual ~test_bloom_filter_t_insert_suite(){};
        virtual void SetUp() {
            //Called befor every TEST_F(test_bloom_filter_t_insert_suite, *)
        };
        virtual void TearDown() {
            //Called after every TEST_F(test_bloom_filter_t_insert_suite, *)
        };
        bloom_filter_t bf;
};
 
/**
 * @brief 
 * @begin_version 
**/
TEST_F(test_bloom_filter_t_insert_suite, case_name1)
{
	bf.create();
	EXPECT_EQ(0, bf.insert((void*)"abcd", 4));
}
 
/**
 * @brief 
**/
class test_bloom_filter_t_maybe_contain_suite : public ::testing::Test{
    protected:
        test_bloom_filter_t_maybe_contain_suite():bf(5*10000*10000, 0.01){};
        virtual ~test_bloom_filter_t_maybe_contain_suite(){};
        virtual void SetUp() {
            //Called befor every TEST_F(test_bloom_filter_t_maybe_contain_suite, *)
        };
        virtual void TearDown() {
            //Called after every TEST_F(test_bloom_filter_t_maybe_contain_suite, *)
        };
        bloom_filter_t bf;
};
 
/**
 * @brief 
 * @begin_version 
**/
TEST_F(test_bloom_filter_t_maybe_contain_suite, case_name1)
{
	bf.create();
	bf.insert("abcd", 4);
	EXPECT_EQ(true, bf.may_contain((void*)"abcd", 4));
	EXPECT_EQ(false, bf.may_contain((void*)"abc", 4));
}

 
